package com.skivingcloud.optional;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.skivingcloud.common.utils.ReturnT;
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableDiscoveryClient
@EnableEncryptableProperties
@RestController
@MapperScan(basePackages = { "com.skivingcloud.**.mapper" })
@EnableCaching
@EnableKnife4j
@ComponentScan(basePackages = { "com.skivingcloud.**" })
public class CommonBootApplication {
    public static void main(String[] args) {
        SpringApplication.run(CommonBootApplication.class, args);
    }

    @GetMapping("helloWorld")
    public ReturnT<String> helloWorld(){
        return ReturnT.ok("Hello World!");
    }

    @RequestMapping("/")
    public String index(){
        return "index";
    }
}
